<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>欢迎语</title>
	<link rel="stylesheet" href="/layui/css/layui.css">
	<link rel="stylesheet" href="/hyqcss/public.css">
	<style type="text/css">
		body{
			background: #e9e9e9;
		}
		/*公共头部带搜索*/
		.public_container{
			margin: 20px;
			background: #fff;
		}
		.public_title_container{
			height: 54px;
			padding: 0 20px;
			font-size: 14px;
			display: flex;
			align-items: center;
			background: #f9f9f9;
			border-bottom: 1px solid #f0f0f0;
		}
		.public_buttonSearch_container{
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 20px;
			background: #fff;
		}
		.public_buttonSearch_container a{
			color: #fff;
			background-color: #1E9FFF;
			text-shadow: 0 -1px 0 rgba(0,0,0,.12);
			height: 24px;
			padding: 4px 15px;
			font-size: 14px;
			border-radius: 2px;
			display: flex;
			align-items: center;
		}
		.public_Search_container{
			position: relative;
		}
		.public_Search_container input{
			width: 240px;
			height: 32px;
			border: 1px solid #d9d9d9;
		}
		.public_Search_container i{
			position: absolute;
			bottom: 6px;
			right: 10px;
			cursor: pointer;
		}
		/*公共头部带搜索 end*/
		.public_table_container{
			padding: 0 20px 20px 20px;
		}
		
	</style>
	<style type="text/css">
		.slide-btn{
			width:100px;
			display:inline-block;
			border:1px solid;
			border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
			border-radius:5px;
			position: relative;
			overflow: hidden;
			cursor: pointer;
		}
		.slide-btn .inner-on,.slide-btn .inner-off{
			width:151px;
			box-sizing:border-box;
			display: inline-block;
			position: relative;
			left:0;
			cursor: pointer;
			transition:left 0.5s;
		}
		.inner-on .left,.inner-off .left{
			width: 50px;
			color: #fff;
			text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
			background:#58b058;
			text-align:center;
			display: inline-block;
			padding: 4px 0;
		}
		.inner-on .space,.inner-off .space{
			width: 51px;
			display: inline-block;
			box-sizing:border-box;
			padding: 4px 0;
			color: #fff;
			background-color: #f5f5f5;
			border-left: 1px solid #cccccc;
			border-right: 1px solid #cccccc;
			text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
			background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
			border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
		}
		.inner-on .right,.inner-off .right{
			width: 50px;
			color: #fff;
			text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
			background:#f9a123;
			text-align:center;
			display: inline-block;
			padding: 4px 0;
		}
	</style>
</head>
<body>
			<!-- 顶部提示框 开始 -->
	<div class="public_tipSetting_contaienr">
		<div class="public_tipSetting_content">
			<p>企业微信后台自带的欢迎语功能仅可以统一配置，无法实现对不同的成员个性化配置，本系统可以实现更强大的欢迎语功能。如果同时在企业微信官方后台配置了欢迎语，本处配置的欢迎语不生效。</p>
			<a href="https://support.qq.com/products/174823/faqs/71347" target="_blank">查看教程</a>
			<svg t="1599462804099" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8813" width="15" height="15"><path d="M512 102.4a409.6 409.6 0 1 0 409.6 409.6 409.6 409.6 0 0 0-409.6-409.6z m181.248 518.144a51.2 51.2 0 0 1-72.704 72.704L512 584.192l-108.544 109.056a51.2 51.2 0 0 1-72.704-72.704L439.808 512 330.752 403.456a51.2 51.2 0 0 1 72.704-72.704L512 439.808l108.544-109.056a51.2 51.2 0 0 1 72.704 72.704L584.192 512z" fill="" p-id="8814"></path></svg>
		</div>
	</div>
	<!-- 顶部提示框 结束 -->
	<div class="public_container">
		<!-- /*公共头部带搜索*/ -->
		<div class="public_content">
			<div class="public_title_container">
				<p>欢迎语</p>
			</div>
			<div class="public_buttonSearch_container">
				<a href="add_welcome_msg.html">+ 新建欢迎语</a>
				<!--<div class="public_Search_container">
					<input type="text" name="title" required  lay-verify="required" placeholder="请输入内容" autocomplete="off" class="layui-input">
					<i class="layui-icon layui-icon-search"></i>
				</div>-->
			</div>
		</div>
		<!-- /*公共头部带搜索*/ end -->
		<!-- 公共表格部分 -->
		<div class="public_table_container layui-form">
			<table class="layui-table" lay-skin="line">
			  <colgroup>
			      <!-- <col width="150">
			      <col>
			      <col width="100">
			      <col width="170">
			      <col width="140"> -->
			    </colgroup>
			    <thead>
			      <tr>
			        <!-- <th>欢迎语类型</th> -->
			        <th>欢迎语内容</th>
			        <th>适用成员</th>
			        <th>创建时间</th>
			        <th>欢迎语状态</th>
			        <th>操作</th>
			      </tr> 
			    </thead>
			    <tbody>
				{loop $res as $r}
			      <tr>
			        <!-- <td>{$r['sendType']}</td> -->
			        <td>{$r['text_content']}</td>
			        <td>
					{if $r['type'] == 1}
						通用
					{else}
						{loop $r['users'] as $user}
							{$h->get_user_by_id($r['wid'],$user)['name']}&nbsp;
						{/loop}
					{/if}
					</td>
			        <td>{$r['ctime']}</td>
			        <td>
			        	<div class="table-public-switch">
			        	  <input type="checkbox" lay-filter="switch1" lay-skin="switch" data-id="{$r['id']}" {if $r['hyy_status'] == 1}checked{/if}>
			        	</div>
						<!-- <div class="slide-btn">
							<div data-id="{$r['id']}"  {if $r['hyy_status'] == 1} style="left :-51px;"class="inner-off inner"{else} class="inner-on inner" {/if}>
								<span class="left">已关闭</span><span class="space">&nbsp;</span><span class="right">已开启</span>
							</div>
						</div> -->
					</td>
			        <td>
					<a class="table-public-btn" href="add_welcome_msg-{$r['id']}.html">编辑</a>
					<a type="button" class="table-public-btn" onclick="del_welcome_msg({$r['id']})">删除</a>
					</td>
			      </tr>
				 {/loop}
			    </tbody>
			</table>
		</div>
		<!-- 公共表格部分 end-->
		 <div class="main-container-h pageing-container-h">
	          <div class="pageing-content-h">
	               <span>{$p->totalnum}条/{$p->totalpage}页</span>
	          </div>
	          <ul class="pageing-content-h">{P weidogsadmin}</ul>
	          </div>
		</div>
	 
	<script src="/cdn/jquery.js"></script>
	<script src="/layui/layui.js"></script>
	<script src="/js/ajax.js"></script>
	<script type="text/javascript">
		layui.use('form', function(){
		  var form = layui.form;
		  form.on('switch(switch1)', function(data){
	      var id = $(this).data("id");
	      if(data.elem.checked == true){
	        myAjaxPost(false, true, 'update_status_kan.html', { id:id}, function (resp) {
	          if(resp.status == "success"){
	            tusi(resp.msg);
	          }else{
	            tusi(resp.msg);
	          }
	        })
	      }else{
	        myAjaxPost(false, true, 'update_status_guan.html', { id:id}, function (resp) {
	          if(resp.status == "success"){
	            tusi(resp.msg);
	          }else{
	            tusi(resp.msg);
	          }
	        })
	      }
	    });
		  //监听提交
		  form.on('submit(formDemo)', function(data){
		    layer.msg(JSON.stringify(data.field));
		    return false;
		  });
		});
	</script>
	<script type="text/javascript">
		function del_welcome_msg(id){
			if(confirm('确定删除吗？')){
				myAjaxPost(false, true, 'del_welcome_msg.html', { id:id}, function (resp) {
						if (resp.status == 'success') {
							tusi(resp.msg);
							setTimeout(function(){
								location.href = 'welcome_msg.html';
							},500);
						}else{
							alert(resp.msg);
						}
					});
			}
		}
		// 
		$('.public_tipSetting_contaienr svg').click(function(){
			$('.public_tipSetting_contaienr').hide();
		})
	</script>
	<script type="text/javascript">
		// $(".inner").on("click",function(){
		// 	if($(this).prop("className") == "inner-on inner"){
		// 		var id = $(this).data("id");
		// 		myAjaxPost(false, true, 'update_status_kan.html', { id:id}, function (resp) {
		// 			if(resp.status == "success"){
		// 				tusi(resp.msg);
		// 			}else{
		// 				tusi(resp.msg);
		// 			}
		// 		})
		// 		$(this).attr("style", "left:-51px");
		// 		$(this).attr("class", "inner-off inner");
		// 	}else{
		// 		var id = $(this).data("id");
		// 		myAjaxPost(false, true, 'update_status_guan.html', { id:id}, function (resp) {
		// 			if(resp.status == "success"){
		// 				tusi(resp.msg);
		// 			}else{
		// 				tusi(resp.msg);
		// 			}
		// 		})
		// 		$(this).attr("style", "left:0px");
		// 		$(this).attr("class", "inner-on inner");
		// 	}
		// })
	</script>
</body>
</html>